import wx
class GlobalEvent:
    MSG_TYPE_SERIES = 1
    TASK_CHANGED = 2
    GRAPH_RESULT = 3
    MESSAGE = 5

    BKT_START = 10
    BKT_FINISHED = 11
    BKT_PROGRESS = 12

    def __init__(self):
        self.observers = []

    def add_observer(self,observer):
        self.observers.append(observer)

    def notify(self, event_type, data):
        for o in self.observers:
            data.update({'event_type': event_type})
            wx.CallAfter(o.handle_data, **data)


import os
def get_config_path():
    file_dir = os.path.dirname(__file__)
    return os.path.dirname(file_dir) + '/config'

g = GlobalEvent()
from engine.data.data_loader import Dataloader
from engine.data.expr.expr_mgr import ExprMgr
E = ExprMgr()
E.init()
D = Dataloader(path=get_config_path() + '/indexes')

